package com.jmemoir.safe.ratelimit.controller;

import com.jmemoir.common.dto.Result;
import com.jmemoir.safe.ratelimit.annotation.RateLimit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试控制层
 *
 * @author Tellsea
 * @date 2023/8/14
 */
@Slf4j
@RestController
@RequestMapping("/rateLimitTest")
public class RateLimitTestController {

    @GetMapping("/testGet")
    @RateLimit(value = 1)
    public Result<String> testGet() {
        System.out.println("执行方法");
        return Result.success("测试 GET 无参方法");
    }
}
